﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_PRODUCT_MATERIAL_HISTORY
// * CreateDate    : 2011-11-8 17:50:51
// * Creater       : CodeSmith
// * LastChangeDate: 2011-11-8 17:50:51
// * LastChanger   : 2011-11-8 17:50:51
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class ProdProductMaterialHistoryEntity : EntityBase
    {
        public ProdProductMaterialHistoryTable TableSchema
        {
            get
            {
                return ProdProductMaterialHistoryTable.Current;
            }
        }

        public ProdProductMaterialHistoryEntity()
        {

        }

        public ProdProductMaterialHistoryEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductMaterialId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_MATERIAL_ID"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
            this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
            this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
        }

        public ProdProductMaterialHistoryEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ProductMaterialId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_MATERIAL_ID"]));
            this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
            this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
            this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
            this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdProductMaterialHistoryTable.Current;
            }
        }

        #region Perporty List
        public string ProductId
        {
            get { return Convert.ToString(GetData(ProdProductMaterialHistoryTable.C_PRODUCT_ID)); }
            set { SetData(ProdProductMaterialHistoryTable.C_PRODUCT_ID, value); }
        }

        public string ProductMaterialId
        {
            get { return Convert.ToString(GetData(ProdProductMaterialHistoryTable.C_PRODUCT_MATERIAL_ID)); }
            set { SetData(ProdProductMaterialHistoryTable.C_PRODUCT_MATERIAL_ID, value); }
        }

        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(ProdProductMaterialHistoryTable.C_QTY)); }
            set { SetData(ProdProductMaterialHistoryTable.C_QTY, value); }
        }

        public string NetSize
        {
            get { return Convert.ToString(GetData(ProdProductMaterialHistoryTable.C_NET_SIZE)); }
            set { SetData(ProdProductMaterialHistoryTable.C_NET_SIZE, value); }
        }

        public string GrossSize
        {
            get { return Convert.ToString(GetData(ProdProductMaterialHistoryTable.C_GROSS_SIZE)); }
            set { SetData(ProdProductMaterialHistoryTable.C_GROSS_SIZE, value); }
        }

        public decimal UnitWeight
        {
            get { return Convert.ToDecimal(GetData(ProdProductMaterialHistoryTable.C_UNIT_WEIGHT)); }
            set { SetData(ProdProductMaterialHistoryTable.C_UNIT_WEIGHT, value); }
        }

        #endregion
    }


}

